package _104MaximumDepthOfBinaryTree;

public class CSolution {

    public static void main(String[] args) {
        System.out.println("aa");
    }

    private int maxDepth(TreeNode root) {
        if(root==null) {
            return 0;
        }
        if(root.left==null && root.right==null) {
            return 1;
        }
        return Math.max(process(root.left,1),process(root.right,1));

    }

    private int process(TreeNode tr,int depth){
        if(tr==null) {
            return depth;
        }
        if(tr.left==null && tr.right == null) {
            return depth+1;
        }
        return Math.max(process(tr.left,depth+1),process(tr.right,depth+1));
    }
}
